/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.model.servlet;

import br.com.model.controllers.UsuarioController;
import br.com.model.entidades.Usuario;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author VemQueTem
 */
public class UpdateUserServlet extends HttpServlet{

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
         UsuarioController usrCtrl = new UsuarioController();
        Usuario usr = new Usuario();
        usr.setId(Integer.parseInt(req.getParameter("txtId")));
        usr.setNome(req.getParameter("txtName"));
        usr.setUsername(req.getParameter("txtUName"));
        usr.setPassword(req.getParameter("txtPassword"));
        usrCtrl.atualizarUsuario(usr);
        resp.sendRedirect("usuarios.jsp");
    }
    
    
}
